/**
 * 
 */
package edu.sjtu.seda.test;

import java.util.concurrent.TimeUnit;

import edu.sjtu.seda.event.Event;
import edu.sjtu.seda.event.EventHandler;

/**
 * @author john.zhu
 *
 */
public class TransferMessage implements EventHandler {
	private Object object = new Object();

	@Override
	public void handle(Event event) {
		long ct = System.nanoTime();
		if(event instanceof Message){
			Message msg = (Message) event;
			msg.setMessage(msg.getMessage()+"has been transformed");
//			System.out.println(msg.getMessage());
			event = msg;
			while((System.nanoTime()-ct)<1000000000L){
				//wait until more than 1s
			}
		}
	}

}
